PlantWise Help

Mass Property Primitive

As a non-graphic element, the mass primitive treats the standard attributes differently than the other primitives. Values for the standard element attributes
  • Local-x-origin
  • Local-y-origin
  • Local-z-origin
specify the location of the center of gravity. The local rotation, display, and layer attributes are ignored.
As an example, an empty center of gravity primitive could be defined as:
Element EmptyCG with
	geometry = mass
	case	= "empty"
	weight	= equipment.weight
	Mx	= EmptyCG.weight *
		(equipment.length ^ 2 + equipment.height ^ 2) / 12.0
	My	= EmptyCG.weight *
		(equipment.width ^ 2 + equipment.height ^ 2)/ 12.0
	Mz	= EmptyCG.weight *
		(equipment.width ^ 2 + equipment.length ^ 2) /12.0
	local-x-origin= 0.0
	local-y-origin= 0.0
	local-z-origin= equipment.height / 2.0
Similarly, a fluid center of gravity could be defined as:
Element FluidCG with
	geometry = mass
	case	= "fluid"
	commodity = NG"
	volume	=	equipment.width * equipment.length *
		equipment.height
	fill-capacity	=	0.9
	density	= equipment.mp_fluid_density or 0.03
	weight	= FluidCG.fill-capacity * FluidCG.volume *
		fluidCG.density
	Mx	= FluidCG.weight *
	(equipment.length ^ 2 + equipment.height ^ 2) / 12.0
	My	= FluidCG.weight *
	(equipment.width ^ 2 + equipment.height ^ 2) / 12.0
	Mz	= FluidCG.weight *
	(equipment.width ^ 2 + equipment.length ^ 2) / 12.0
	local-x-origin	= 0.0
	local-y-origin	= 0.0
	local-z-origin	= equipment.height *
		(FluidCG.fill-capacity / 2.0)
There are three attributes you may want to reference in the geometry rules that are not generally determined until a Mass Properties calculation has occurred: commodity, density, and weight. There are functions that will calculate those values within the geometry rule.
To obtain equipment commodity:
calc-default-equipment-commodity()
This function will return the commodity from:
  • the equipment input (mp_fluid_commodity);
  • the commodity of the largest inlet pipeline; or
  • NIL
To obtain equipment density:
calc-mass-density-from-commodity([<commodity expression>])
This function will return the density from:
  • the equipment input (mp_fluid_density);
  • a table lookup on the argument commodity (if given);
  • a table lookup on the default calculated commodity (from the function above); or
  • 0.0
Examples:
density = calc-mass-density-from-commodity()
density = calc-mass-density-from-commodity("AA")
density = calc-mass-density-from-commodity
	(fluidCG.commodity)
Equipment weight is derived from:
calc-wt-from-volume-and-commodity(<volume expression>
	[<commodity expression>])
This function will return the weight from:
  • the product of the volume and mass density, if the commodity is provided; or
  • the product of the volume and the default calculated commodity (from the commodity function above).
Examples:
weight = calc-wt-from-volume-and-commodity
	(fluidCG.volume, "AA")
weight = calc-wt-from-volume-and-commodity
	(fluidCG.volume)